package com.studykun.client.model;

import java.util.ArrayList;
import java.util.List;

import com.studykun.client.model.js.JsDeck;

public class Deck {
  private String name_;
  private ArrayList<Card> cards_ = new ArrayList<Card>();
  
  public Deck(
      final JsDeck jsDeck) {
    name_ = jsDeck.name();
    
    final int cardsLength = jsDeck.cards().length();
    
    for (int i = 0; i < cardsLength; ++i) {
      cards_.add(new Card(jsDeck.cards().get(i)));
    }
  }
  
  public String name() {
    return name_;
  }
  
  public String name(
      final String name) {
    name_ = name;
    return name;
  }
  
  public List<Card> cards() {
    return cards_;
  }
}
